﻿namespace SLClient.CustomerControls
{
    using System;

    public class ServerDateTime
    {
        private static double timeSpanOfServerTimeAndLocalTime = 0.0;

        public static DateTime Now
        {
            get
            {
                return DateTime.Now.AddSeconds(timeSpanOfServerTimeAndLocalTime);
            }
            set
            {
                TimeSpan span = (TimeSpan) (value - DateTime.Now);
                timeSpanOfServerTimeAndLocalTime = span.TotalSeconds;
            }
        }
    }
}

